import request from '@/utils/request'

const base_api = '/admin/system/sysUser'

//分页条件查询
export const findByPageUser = (current,limit,queryDto)=>{
    return request({
        url: `${base_api}/findByPage/${current}/${limit}`,
        method: 'get',
        params: queryDto,
      })
}

//保存
export const saveBySysUser = (saveDto)=>{
  return request({
      url: `${base_api}/saveSysUser`,
      method: 'post',
      data: saveDto,
    })
}

//修改
export const updateByUser = (updateDto) =>{
  return request({
    url: `${base_api}/updateUser`,
    method: 'put',
    data: updateDto
  })
}

// 根据id删除用户
export const DeleteSysUserById = (userId) => {
  return request({
      url: `${base_api}/deleteUser/${userId}`,
      method: 'delete'
  })
}

// 给用户分配角色请求
export const DoAssignRoleToUser = (assginRoleVo) => {
  return request({
      url: `${base_api}/doAssign`,
      method: 'post',
      data: assginRoleVo
  })
}